﻿using Newtonsoft.Json;

namespace LocalTest.Application.Contracts.Shared;

public record SearchFields
{
    [JsonProperty(propertyName: "getKeyWords")]
    public List<KeyWordItem> GetKeyWords { get; set; } = new List<KeyWordItem>(0);

    public String Logic { get; set; } = String.Empty;

    private List<String> TotalHeader { get; set; } = new List<string>(0);

    public class KeyWordItem(String name, String title, object? value = null)
    {
        [JsonProperty(propertyName: "default")]
        public Object DefaultValue { get; set; } = "";

        public String Name { get; set; } = name;
        public String Title { get; set; } = title;
        public bool Required { get; set; }
        public String Type { get; set; } = "text";
        public Object? Value { get; set; } = value;
    }
}